package com.xxgc.mybatis.dao.dao.extend;

import com.xxgc.mybatis.dao.entity.extend.UserAndMoney;
import org.apache.ibatis.annotations.Select;

import java.util.List;

//扩展接口  非特殊情况只做查询语句扩展
public interface UserAndMoneyMapper {
    //根据用户id查询他的消费记录
    @Select("SELECT `u_name`,`m_number`,`m_type`,`m_payment_method`,`m_create_money`\n" +
            "FROM `users`,`money`\n" +
            "WHERE `u_id` = `m_user`\n" +
            "AND `u_id` = #{uId}")
    List<UserAndMoney> selectByPrimaryKey(Long uId);

}
